$(function() {
	//禁止滚动
	function stop_wheel(e) {
		e.preventDefault();
	}

	function stop_move(e) {
		e.preventDefault();
	}

	function stop_scroll(e) {
		e.preventDefault();
		$(window).scrollTop(0);
	}

	function stopScroll() {
		$(document).on("mousewheel", stop_wheel)

		$(document).on("touchmove", stop_move)

		$(window).on("scroll", stop_scroll)
	}
	//恢复滚动
	function resumeScroll() {
		$(document).off("mousewheel", stop_wheel);
		$(document).off("touchmove", stop_move);
		$(window).off("scroll", stop_scroll);
	}
	//目录页显示隐藏
	var catalog_page = document.getElementById("catalog_page_id");

	catalog_page.style.visibility = "hidden";

	document.getElementById("catalog").onclick = function() {
		catalog_page.style.visibility = "visible";
		catalog_page.style.animationName = "bounceInLeft";
		catalog_page.style.width  = window.innerWidth+"px";
		catalog_page.style.height  = window.innerHeight+"px";
		stopScroll();
		//	document.documentElement.style.overflowY = 'hidden';
		//	document.addEventListener("touchmove",bodyScroll,false);
	}

	document.getElementById("catalog_page_close").onclick = function() {
		catalog_page.style.animationName = "bounceOutLeft";
		resumeScroll();
		//	document.body.style.height  = "auto";
		//	document.documentElement.style.overflowY = 'scroll';
		//	document.removeEventListener("touchmove",bodyScroll,false);
	}

	//搜索页显示隐藏
	var search_page = document.getElementById("search_page_id");

	search_page.style.visibility = "hidden";

	document.getElementById("search").onclick = function() {
		search_page.style.visibility = "visible";
		search_page.style.animationName = "bounceInRight";
		search_page.style.width  = window.innerWidth+"px";
		search_page.style.height  = window.innerHeight+"px";
		stopScroll();
		//	document.documentElement.style.overflowY = 'hidden';
		//	document.addEventListener("touchmove",bodyScroll,false);
	}

	document.getElementById("return").onclick = function() {
		search_page.style.animationName = "bounceOutRight";
		resumeScroll();
		//	document.documentElement.style.height  = "auto";
		//	document.documentElement.style.overflowY = 'scroll';
		//	document.removeEventListener("touchmove",bodyScroll,false);
	}
});
//搜索框字体大小调节
document.getElementById("search_input").addEventListener("input", function() {
	var ele = document.getElementById("search_input");
	var len = document.getElementById("search_input").value;
	console.log(len.length);
	if(len.length > 0) {
		ele.style.fontSize = "20px";
	} else {
		ele.style.fontSize = "100px";
	}
});